<template>
  <div class="user-product">
    <div class="product-main">
      <div class="product-item flex-row space-between">
        <div class="product-item-list" v-for="item in productList" :key="item.infoId">
          <img class="img" :src="item.imageUrl" mode="aspectFill" lazy-load @click.stop="clickProduct(item)"/>
          <p class="list-title ellipsis2" @click.stop="clickProduct(item)">{{item.title}}</p>
          <div class="flex-row space-between flex-align list-bottom">
            <div class="list-bottom-right">
              <p class="marketPrice">
                <span>{{item.date}}</span>
              </p>
            </div>
            <p class="btn" @click.stop="clickProduct(item)">
              {{item.statusDesc}}
            </p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>

export default {
  name: 'user-product',
  data () {
    return {
      productList: []
    }
  },
  props: {
  },
  computed: {
  },
  methods: {
    // 产品数据
    handleProducts () {
      this.productList = [
        {
          key: '1',
          imageUrl: 'https://game.img.ismartgo.cn/test/231017/947000f6-a53b-4659-9efb-427f8f16a4fb.png',
          title: '施华蔻Schwarzkopf洗发|Bonacure Keratin Smooth Perfect Micellar Shampoo (250ml)',
          goodsId: '176769',
          code: '6903148255186',
          date: '2023-10-17',
          statusDesc: '进行中',
          status: 0
        },
        {
          key: '2',
          imageUrl: 'https://game.img.ismartgo.cn/test/231017/947000f6-a53b-4659-9efb-427f8f16a4fb.png',
          title: '施华蔻Schwarzkopf洗发|Bonacure Keratin Smooth Perfect Micellar Shampoo (250ml)',
          goodsId: '176769',
          code: '6903148255186',
          date: '2023-10-17',
          statusDesc: '已审核',
          status: 2
        },
        {
          key: '3',
          imageUrl: 'https://game.img.ismartgo.cn/test/231017/947000f6-a53b-4659-9efb-427f8f16a4fb.png',
          title: '施华蔻Schwarzkopf洗发|Bonacure Keratin Smooth Perfect Micellar Shampoo (250ml)',
          goodsId: '176769',
          code: '6903148255186',
          date: '2023-10-17',
          statusDesc: '已参与',
          status: 1
        },
        {
          key: '4',
          imageUrl: 'https://game.img.ismartgo.cn/test/231017/947000f6-a53b-4659-9efb-427f8f16a4fb.png',
          title: '施华蔻Schwarzkopf洗发|Bonacure Keratin Smooth Perfect Micellar Shampoo (250ml)',
          goodsId: '176769',
          code: '6903148255186',
          date: '2023-10-17',
          statusDesc: '已参与',
          status: 1
        },
        {
          key: '5',
          imageUrl: 'https://game.img.ismartgo.cn/test/231017/947000f6-a53b-4659-9efb-427f8f16a4fb.png',
          title: '施华蔻Schwarzkopf洗发|Bonacure Keratin Smooth Perfect Micellar Shampoo (250ml)',
          goodsId: '176769',
          code: '6903148255186',
          date: '2023-10-17',
          statusDesc: '进行中',
          status: 0
        }
      ]
    },
    // 点击产品
    clickProduct (item) {
      this.$router.push(`/productdetail/${item.infoId}?treeId=${item.treeId}`)
    }
  },
  mounted () {
    this.handleProducts()
  }
}
</script>
<style lang="less" scoped>
.user-product {
  padding-top: 20px;
  .product-main {
    width: 100vw;
    .product-item {
      padding: 0 16px;
      flex-wrap: wrap;
      background-color: #f6f6f6;
      font-family: PingFang SC;
      .product-item-list {
        // position: relative;
        flex-shrink: 0;
        width: 165px;
        background: #fff;
        border-radius: 5px 5px 0 0;
        margin-bottom: 13px;
        .img {
          width: 100%;
          height: 92.5px;
          border-radius: 5px 5px 0 0;
        }
        .list-title {
          font-size: 14px;
          line-height: 19px;
          font-weight: 800;
          color: #222222;
          height: 37px;
          margin: 5px 0;
          padding: 0 10px;
          display: -webkit-box;
          -webkit-box-orient: vertical;
          -webkit-line-clamp: 2;
          overflow: hidden;
        }
        .list-bottom {
          position: relative;
          padding: 0 8px 8px;
          .list-bottom-right {
            display: flex;
            align-items: center;
            .salePrice {
              font-size: 18px;
              color: #FD6448;
              font-family: 'DIN';
              vertical-align: bottom;
              margin-top: 5px;
              u, span {
                font-size: 11px;
                vertical-align: bottom;
                margin-top: 3px;
              }
            }
            .marketPrice {
              color: #9b9b9b;
              margin-top: 5px;
              font-size: 11px;
              span {
                font-size: 10px;
              }
            }
            .num {
              font-size: 12px;
              font-weight: 400;
              color: #999999;
            }
          }
          .btn {
            position: absolute;
            top: -80px;
            right: 10px;
            height: 24px;
            width: 50px;
            font-size: 12px;
            font-family: PingFang SC;
            font-weight: 400;
            color: #fff;
            line-height: 24px;
            border-radius: 24px;
            text-align: center;
            background-color: #0B8BEF;
            box-sizing: border-box;
          }
        }
      }
    }
  }
}
</style>
